
<!--
  /**************************************************
  * @ orderdetailmodify.jsp
  *
  * Copyright   2006 Hitrust Technology Inc.
  * Developed by SDC, Hitrust.
  * All Rights Reserved.
  *
  * Modify History:
  *  v1.00, 2006/03/20, Jenny Li
  *  1) first release
  /**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<%@page import="system.LoginContext"%>
<%@page import="framework.core.SrvContext"%>
<html>
<head>
<title>更改订单信息</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/hi-check.js"></SCRIPT>
<%
ArrayList wareList = (ArrayList)request.getAttribute("orderdept");
	ArrayList tManuf1 = (ArrayList) request.getAttribute("manufacture1");
	HashMap tMap1 = (HashMap) request.getAttribute("manufacturetyp2");
	HashMap tMap2 = (HashMap) request.getAttribute("manufacturetyp3");
	ResultProcess tOrder = (ResultProcess)request.getAttribute("order");
	HashMap tHm = (HashMap)request.getAttribute("provider");
	ArrayList tList = new ArrayList();
	String [] tStr = null;
	String isRequery  = (String)request.getAttribute("requery");
%>
<script>

	var counter;
	function control(val){
		if(val == 'requery'){
			<%
				if(isRequery != null && isRequery.equals("true")){
			%>
			orderdetailmodifyform.action = "<%=response.encodeURL(root+"/A150602.do")%>";
    		orderdetailmodifyform.submit();	
			<%		
				}
			%>
		}
	}

	function process(val){
		if(val == 'Q'){
			var tStr = "";
			var tEnd = "";
			if(!isEmpty(orderdetailmodifyform.orderCreateDateStr.value)){
				tStr = orderdetailmodifyform.orderCreateDateStr.value.substr(0,4) + orderdetailmodifyform.orderCreateDateStr.value.substr(5,2) + orderdetailmodifyform.orderCreateDateStr.value.substr(8,2);
				
			}
			if(!isEmpty(orderdetailmodifyform.orderCreateDateEnd.value)){
				tEnd = orderdetailmodifyform.orderCreateDateEnd.value.substr(0,4) + orderdetailmodifyform.orderCreateDateEnd.value.substr(5,2) + orderdetailmodifyform.orderCreateDateEnd.value.substr(8,2);
			}
			if(parseInt(tStr) > parseInt(tEnd)){
					alert("订单创建周期的开始日期不能大于截止日期！");
					return false;
			}
			orderdetailmodifyform.action = "<%=response.encodeURL(root+"/A150602.do")%>";
    		orderdetailmodifyform.submit();			
		}else if(val == 'C'){
			orderdetailmodifyform.orderDetailId.value ="";
			orderdetailmodifyform.orderDeptId.selectedIndex=0;
			orderdetailmodifyform.manuftype1.value="0";
			orderdetailmodifyform.providerName.value="";
		    listbox = document.getElementById("manuftype2");
		    listbox.length = 0;
		    var option = new Option();
		    option.text = "---二级---";
		    option.value = "0";
		    listbox.options[listbox.length] = option;
		
	        listbox = document.getElementById("manuftype3");
	        listbox.length = 0;
	        var option = new Option();
	        option.text = "---三级---";
	        option.value = "0";
	        listbox.options[listbox.length] = option;		
	        
			orderdetailmodifyform.concentricityId.value = "";
			orderdetailmodifyform.manufInfo.value = "";
			orderdetailmodifyform.orderCreateDateStr.value = "";
			orderdetailmodifyform.orderCreateDateEnd.value = "";
            orderdetailmodifyform.drawingpiececode.value = "";
			orderdetailmodifyform.orderDetailStatus.value = "0000";
			return false;		
		}else if(val == 'S'){
			if(pager.orderDetailIds != null){		
				if(!isCheckBoxselected(pager,pager.orderDetailIds)){
					alert("请至少选择一笔订单");
					return false;
				}else{
					var icheckChar = "0123456789.";
                    var sel=document.getElementsByName("provManufInfos");
					if(document.pager.orderDetailIds.length > 1){
						var selectedDetailIds = document.pager.orderDetailIds;
						//alert("length=" + selectedDetailIds.length);
						for(i=0; i<selectedDetailIds.length;i++){
							if(selectedDetailIds[i].checked){
								if(isEmpty(pager.orderCounts[i].value)){
									alert("订货数量不能为空!");
									return false;
								}
								if(pager.orderCounts[i].value==0){
									alert("订货数量必须大于0!");
									return false;
								}
                                var opts=sel[i].options;
                                if(opts.length<=0){
                                    alert('选择的记录中包含有无效供应商的订单明细，\n该明细不能修改保存！');
                                    return false;
                                }
								if(HiScript.checkDecimal(pager.orderCounts[i].value,icheckChar,'2','订货数量')){
									//alert("订货数量必须为数字（包含小数）!");
									return false;
								}
								submitform.orderDetailIds2[i].checked = true;
								submitform.orderDetailIds2[i].value=pager.orderDetailIds[i].value;
								submitform.orderCounts2[i].checked = true;
								submitform.orderCounts2[i].value=pager.orderCounts[i].value;
								submitform.provManufInfos2[i].checked = true;
								submitform.provManufInfos2[i].value = pager.provManufInfos[i].value;
								submitform.deliverGoodsDates2[i].checked = true;
								submitform.deliverGoodsDates2[i].value = pager.deliverGoodsDates[i].value;
								submitform.deliverGoodsTimes2[i].checked = true;								
								submitform.deliverGoodsTimes2[i].value = pager.deliverGoodsTimes[i].value;
								submitform.orderDtlStatus2[i].checked = true;
								submitform.orderDtlStatus2[i].value = pager.orderDtlStatus[i].value;
								submitform.isTradeFlatManuf2[i].checked = true;
								submitform.isTradeFlatManuf2[i].value = pager.isTradeFlatManuf[i].value;
								submitform.isTradeFlatProvider2[i].checked = true;
								submitform.isTradeFlatProvider2[i].value = pager.isTradeFlatProvider[i].value;
                                submitform.sign2[i].checked = true;
                                submitform.sign2[i].value = pager.sign[i].value;
							}
						}
					}else {
                    var sel=document.getElementsByName("provManufInfos");
						if(pager.orderDetailIds.checked){
								if(isEmpty(pager.orderCounts.value)){
									alert("订货数量不能为空!");
									return false;
								}
                                var opts=sel[0].options;
                                if(opts.length<=0){
                                    alert('选择的记录中包含有无效供应商的订单明细，\n该明细不能修改保存！');
                                    return false;
                                }
								//alert(pager.orderCounts.value);	
								if(HiScript.checkDecimal(pager.orderCounts.value,icheckChar,'2','订货数量')){
									//alert("订货数量必须为数字（包含小数）!");
									return false;
								}													
								submitform.orderDetailIds2.checked = true;
								submitform.orderDetailIds2.value=pager.orderDetailIds.value;	
								submitform.orderCounts2.checked = true;	
								submitform.orderCounts2.value=pager.orderCounts.value;
								submitform.provManufInfos2.checked = true;
								submitform.provManufInfos2.value = pager.provManufInfos.value;
								submitform.deliverGoodsDates2.checked = true;
								submitform.deliverGoodsDates2.value = pager.deliverGoodsDates.value;
								submitform.deliverGoodsTimes2.checked = true;
								submitform.deliverGoodsTimes2.value = pager.deliverGoodsTimes.value;
								submitform.orderDtlStatus2.checked = true;	
								submitform.orderDtlStatus2.value = pager.orderDtlStatus.value;	
								submitform.isTradeFlatManuf2.checked = true;
								submitform.isTradeFlatManuf2.value = pager.isTradeFlatManuf.value;
								submitform.isTradeFlatProvider2.checked = true;
								submitform.isTradeFlatProvider2.value = pager.isTradeFlatProvider.value;
                                submitform.sign2.checked = true;
                                submitform.sign2.value = pager.sign.value;																	
						}
					}
					if(confirm("是否确定调整所选订单？")){						
						document.submitform.action = "<%=response.encodeURL(root+"/A150603.do")%>";			
						document.submitform.submit();
					}else{
						return false;
					}			
				}		
			}else{
				return false;
			}	
		}
	}
	function openwin(obj){
		var result = null;	
		result = showModalDialog("<%=response.encodeURL(root+"/A150404.do")%>?params=" + obj, window,"status:no;unadorned:no;dialogWidth:900px;dialogHeight:1200px;help:no;");
		if(result != null){
			process('Q');
		}
	}		
function change1(optval){
  var val = optval;
  if(val=='0'){
    var listbox = document.getElementById("manuftype2");
    listbox.length = 0;
    var option = new Option();
    option.text = "---二级---";
    option.value = "0";
    listbox.options[listbox.length] = option;
    change2(optval);
  }else{
      var counter="0";
    <%if(tMap1 !=null){
      Collection tCollection = tMap1.keySet();
      Iterator tIterator = tCollection.iterator();
      while(tIterator.hasNext()){
        String tKey = (String)tIterator.next();
        tList = (ArrayList)tMap1.get(tKey);%>
        if(val == '<%=tKey%>'){
		  counter = "1";
          var listbox = document.getElementById("manuftype2");
          listbox.length = 0;
          var option = new Option();
          option.value = "0";
          option.text = "---二级---";
          listbox.options[listbox.length] = option;
          <%
	          	for(int n=0;n<tList.size();n++){
		            GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
		            String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
		            String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
		            var temp1 = '<%=categoryId%>';
		            var temp2 = '<%=categoryName%>';
		            var option = new Option();
		            option.value = temp1;
		            option.text = temp2;
		            listbox.options[listbox.length] = option;
           <%
	       		}
           %>
			change2('0');           
         }
         
    <%
    	}
    %>
    	if(counter == '0'){
          var listbox = document.getElementById("manuftype2");
          listbox.length = 0;
          var option = new Option();
          option.value = "0";
          option.text = "---二级---";
          listbox.options[listbox.length] = option;  
          change2('0');    	
    	}
    <%  
    }
    %>
   }
}
    function change2(optval){
      var val = optval;
      if(val=='0'){
        var listbox = document.getElementById("manuftype3");
        listbox.length = 0;
        var option = new Option();
        option.text = "---三级---";
        option.value = "0";
        listbox.options[listbox.length] = option;

      }else{
      	var counter = "0";
        <%if(tMap2 !=null){
          Collection tCollection = tMap2.keySet();
          Iterator tIterator = tCollection.iterator();
          while(tIterator.hasNext()){
            String tKey = (String)tIterator.next();
            tList = (ArrayList)tMap2.get(tKey);%>
            if(val == '<%=tKey%>'){
              counter = "1";
              var listbox = document.getElementById("manuftype3");
              listbox.length = 0;
              var option = new Option();
              option.text = "---三级---";
              option.value = "0";
              listbox.options[listbox.length] = option;
              <%for(int n=0;n<tList.size();n++){
                GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
                String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
                String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
                var temp1 = '<%=categoryId%>';
                var temp2 = '<%=categoryName%>';
                var option = new Option();
                option.value = temp1;
                option.text = temp2;
                listbox.options[listbox.length] = option;
                <%}%>
              }
          <%
          }
          %>
          if(counter == '0'){
		        var listbox = document.getElementById("manuftype3");
		        listbox.length = 0;
		        var option = new Option();
		        option.text = "---三级---";
		        option.value = "0";
		        listbox.options[listbox.length] = option;          
          }
          <%
            }%>
          }
        }	
</script>
</head>

<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="control('requery')">
<form name=orderdetailmodifyform method="get" >
<p><br></p>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td height="20">
			<table width="100%" border="0" cellspacing="0" cellpadding="1">
				<tr height="20">
					<td height="30" width="758" class="mtxt_black">更改订单信息
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td class="bg_line" height="2"></td>
	</tr>
</table>
<br>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center width="15%">订单明细编号</TD>
					<TD align=left class="bg_row_odd" width="35%">
					<input type="text" name="orderDetailId" value="<%=request.getParameter("orderDetailId")==null? "":request.getParameter("orderDetailId") %>" maxlength="11"></TD>					
					<TD class="bg_column" align=center width="15%">供应商</TD>
					<TD align=left class="bg_row_odd" width="35%">
					<input type="text" name="providerName" value="<%=request.getParameter("providerName")==null? "":request.getParameter("providerName") %>" maxlength="100"></TD>					
				</TR>
				<TR height=20>							
					<TD class="bg_column" align=center>订货单位</TD>
					<TD left=right class="bg_row_odd" colspan="3">
						<select name="orderDeptId">					
						<option value="<%=LoginContext.get(new SrvContext(request,response)).getLoginWarehouseCode() %>">---全部---</option>
              <%
                            String tOrderDept = request.getParameter("orderDeptId")==null?"":request.getParameter("orderDeptId");
                            if(wareList != null && wareList.size() > 0 ){
                                    for(int i=0; i<wareList.size(); i++){
                                        GSWareHouseBean tmp=(GSWareHouseBean)wareList.get(i);
                                        if(tmp != null && tOrderDept.equals(tmp.getCode())){
                            %>
                                            <option value="<%=tmp.getCode()%>" selected>
                                            <%=tmp.getName()%></option>
                            <%                  
                                        }else{
                            %>
                                            <option value="<%=tmp.getCode()%>"><%=tmp.getName()%></option>
                            <%          
                                        }
                                    }
                                }
                        %>
						</select>
					</TD>
				</TR>							
				<TR height=20>
					<TD class="bg_column" align=center>集中编码</TD>
					<TD align=left class="bg_row_odd">
					<input type="text" name="concentricityId" maxlength="20" value="<%=request.getParameter("concentricityId")==null?"":request.getParameter("concentricityId")%>">
					</TD>
					<TD class="bg_column" align=center width="15%">订单明细状态</TD>
					<TD align=left class="bg_row_odd" width="35%">
						<select name="orderDetailStatus">					
						<option value="0000">---全部---</option>
						<%
							String tOrderDetailStatus = request.getParameter("orderDetailStatus");
							String[][] tDetailStatus = GSBaseManager.getAllBusOrderDetailStatusForModify();
							if(tDetailStatus != null && tDetailStatus.length > 0 ){
								for(int i=0; i<tDetailStatus.length; i++){
									String[] temp = tDetailStatus[i];
									if(tOrderDetailStatus != null && tOrderDetailStatus.equals(temp[0])){
						%>
										<option value="<%=temp[0]%>" selected>
										<%=temp[1]%></option>
						<%				    
									}else{
						%>
										<option value="<%=temp[0]%>" >
										<%=temp[1]%></option>
						<%			
									}
								}
							}
						%>
						</select>
					</TD>						
				</TR>	
				<TR height=20>							
					<TD class="bg_column" align=center>产品分类</TD>
					<TD left=right class="bg_row_odd" colspan="3">
				      <select name="manuftype1" onChange="change1(this.value)">
				        <option value="0">---一级---</option>
				        <%
				        String tManufType1 = request.getParameter("manuftype1");
				        if (tManuf1 != null && tManuf1.size() > 0) {
				          for (int i = 0; i < tManuf1.size(); i++) {
				            GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean) tManuf1.get(i);
				            if (tManufType1 != null && tManufType1.equals(tGSManufactureBean.getGs_manufacture_category_id())) {
				              %>
				              <option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>" selected><%=tGSManufactureBean.getGs_manufacture_category_name()%>        </option>
				              <%} else {      %>
				              <option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>"><%=tGSManufactureBean.getGs_manufacture_category_name()%>        </option>
				              <%
				              }
				            }
				          }
				          %>
				      </select>
				      <select id="manuftype2" name="manuftype2" onChange="change2(this.value)">
				        <option value="0">---二级---</option>
				        <%
				        String tManufType2 = request.getParameter("manuftype2");
				        if (tManufType1 != null && !tManufType1.equals("0")) {
				          ArrayList temp = (ArrayList) tMap1.get(tManufType1);
				          if (temp != null && temp.size() > 0) {
				            for (int i = 0; i < temp.size(); i++) {
				              GSManufactureCategoryBean tGSManuf2 = (GSManufactureCategoryBean) temp.get(i);
				              if (tManufType2 != null && tManufType2.equals(tGSManuf2.getGs_manufacture_category_id())) {
				                %>
				                <option value="<%=tManufType2%>" selected><%=tGSManuf2.getGs_manufacture_category_name()%>        </option>
				                <%} else {      %>
				                <option value="<%=tGSManuf2.getGs_manufacture_category_id()%>"><%=tGSManuf2.getGs_manufacture_category_name()%>        </option>
				                <%
				                }
				              }
				            }
				          }
				          %>
				      </select>
				      <select name="manuftype3" id="manuftype3">
				        <option value="0">---三级---</option>
				        <%
				        String tManufType3 = request.getParameter("manuftype3");
				        if (tManufType2 != null && !tManufType2.equals("0")) {
				          //int tIntManufType3 = Integer.parseInt(tManufType3);
				          ArrayList temp = (ArrayList) tMap2.get(tManufType2);
				          if (temp != null && temp.size() > 0) {
				            for (int i = 0; i < temp.size(); i++) {
				              GSManufactureCategoryBean tGSManuf3 = (GSManufactureCategoryBean) temp.get(i);
				              if (tManufType3 != null && tManufType3.equals(tGSManuf3.getGs_manufacture_category_id())) {
				                %>
				                <option value="<%=tGSManuf3.getGs_manufacture_category_id()%>" selected><%=tGSManuf3.getGs_manufacture_category_name()%>        </option>
				                <%} else {      %>
				                <option value="<%=tGSManuf3.getGs_manufacture_category_id()%>"><%=tGSManuf3.getGs_manufacture_category_name()%>        </option>
				                <%
				                }
				              }
				            }
				          }
				          %>
				      </select>					
					</TD>
				</TR>															
				<TR height=20>
					<TD class="bg_column" align=center>产品信息</TD>
					<TD align=left class="bg_row_odd" colspan="3">
					<input type="text" name="manufInfo" maxlength="200" value="<%=request.getParameter("manufInfo")==null?"":request.getParameter("manufInfo")%>">（<FONT color="#ff0033">对产品名称、型号、规格、品牌、生产厂商、附加属性等关键字的模糊查询</FONT>）&nbsp;
					</TD>
				</TR>
                <%
                SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-MM-dd");
                Date d = new Date();
                String strNow = String.valueOf(bartDateFormat.format(d));
                long l=(long)259200*(long)10000;
                Date d2 = new Date(System.currentTimeMillis()-l);
                String strMothAgo = String.valueOf(bartDateFormat.format(d2));
                %> 
				<TR height=20>	
					<TD class="bg_column" align=center>创建时间</TD>
					<TD align=left class="bg_row_odd" >
					
					<%=framework.custom.UIManager.generateDateInput("orderCreateDateStr",
							request.getParameter("orderCreateDateStr")==null?strMothAgo:request.getParameter("orderCreateDateStr"))%>
					
					至
					<%=framework.custom.UIManager.generateDateInput("orderCreateDateEnd",
							request.getParameter("orderCreateDateEnd")==null?strNow:request.getParameter("orderCreateDateEnd"))%>
					
					
					</TD>
                    <td class="bg_column" align=center >图件号</td>
                <td align=left class="bg_row_odd" >
                <input type="text" name="drawingpiececode" value="<%=request.getParameter("drawingpiececode")==null? "":request.getParameter("drawingpiececode") %>">
                </td>
				</TR>
                 
			</table>
		</td>
	</tr>
</table>
<%
if(tOrder != null) {
    int totalRecords = 0;
    if(request.getAttribute("totalRecords")!=null){
        totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
    }
    int defaultPageSize =10;
    if(request.getAttribute("pageSize")!=null){
        defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
    }
    tList=tOrder.getAllRecoreds();
%>          
<page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'>
</page:pager>
<%} %>
</form>
    <p align="center">  
		<input type="button" class="kuang" value="查询" onclick="process('Q')"/>&nbsp;
		<input type="button" class="kuang" value="清空" onclick="process('C')"/>&nbsp;				
    </p>
<%
	
	if(tOrder != null){
%>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
            <form name='pager' method="post">
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20>
                        <td class=top align=middle colspan="19"> 
                        <div align="center" class="txt_content"><b>订单信息列表</b>
                    	  </div>
						</td>					
					</tr> 
                    <tr class="bg_column" height=20> 
						<td align=middle class=top>
						<div class="txt_content">全选<input type="checkbox" name="indexs" onClick="SelectAllCheckBox(pager,'orderDetailIds')"></div>
						</td> 
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">订单明细编号</div>
						</td>		
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">集中编码</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">产品名称</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">规格</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">型号</div>
						</td>																																				
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">品牌</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">图件号</div>
                        </td>											
						<td class="top" align="center">
						  <div class="txt_content" align="center">订货单位</div>
						</td>						
						<td class="top" align="center">
						  <div class="txt_content" align="center">产品类型</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">供应商</div>
						</td>							
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">订货数量</div>
						</td>																					
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">价格（元）</div>
						</td>										
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">总价（元）</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">明细状态</div>
						</td>																																			
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">送货日期</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">送货时间</div>
						</td>	
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">结算模式</div>
                        </td>   																	
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">详细信息</div>
						</td>																																				
					</tr>
					<%
						
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
							<tr <%=tTempStr%> height=20>
								<td class=top> 								
									<div align="center" class="txt_content">
										<input type="checkbox" id="orderDetailIds<%=i %>" name="orderDetailIds" value="<%=tStr[0]%>">	
										<input type="hidden" name="orderIds" value="<%=tStr[17]%>">	
										<input type="hidden" id="issta<%=i %>" name="orderDtlStatus" value="<%=tStr[13]%>">	
										<input type="hidden"  id="istf<%=i %>" name="isTradeFlatManuf" value="<%=tStr[7]%>">
										<input type="hidden" name="isTradeFlatProvider" value="<%=tStr[18]%>">
                                        <input type="hidden" name="sign" value="<%=tStr[21]%>">
                                        <input type="hidden" id="oldproid<%=i %>" name="oldproid" value="<%=tStr[16]%>"> 																																																		
									</div>
								</td>								
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tStr[0]%>
									</div>
								</td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tStr[1]%>
									</div>
								</td>														
								<td class=top align=middle > 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root+"/A150103.do")%>?&concentricityId=<%=tStr[1]%>" target="_blank"><%=tStr[2]%></a>
									</div>
								</td>							
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[3]%>
									</div>
								</td>
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[4]%>
									</div>
								</td>				
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tStr[5]%>
									</div>
								</td>
                                <td class=top align=middle>                                 
                                    <div align="center" class="txt_content">
                                    <%=tStr[23]%>
                                    </div>
                                </td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tStr[6]%>
									</div>
								</td>									
								<td class=top align=middle> 
									<div align="center" class="txt_content" id="divismanuf<%=i %>">
									<%=GSBaseManager.getProductTypeByCode(tStr[22])%>
									</div><input type="hidden" name="ismanuf" id="ismanuf<%=i %>">
								</td>																													
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<select name="provManufInfos" onChange="changepr(this,price<%=i%>,count<%=i%>,total<%=i%>,mode<%=i%>,divmode<%=i%>,divismanuf<%=i %>,ismanuf<%=i %>,istf<%=i %>,issta<%=i %>,oldproid<%=i %>)">									
									<%
										String temp = "";
										ArrayList tList2 = (ArrayList)tHm.get(tStr[1]);
										if(tList2 != null && tList2.size() > 0){
										    for(int j=0; j<tList2.size(); j++){
										        GSProviderVO tProv = (GSProviderVO)tList2.get(j);
										        if(tProv.providerId.equals(tStr[16])){
													if(tStr[7].equals("0") && tStr[18].equals("0")){
														temp = "(采购网配送)";
													}										            
									%>
													<option value="<%=tProv.providerId + "-" + tProv.manufId +"-"+tProv.manufUnitprice+"-"+tProv.mode+"-"+tProv.modename+"-"+tProv.isTradeFlatManuf+"-"+GSBaseManager.getIsTradeManuf(tProv.isTradeFlatManuf)+"-"+tProv.validity%>" selected><%=tProv.providerName%><%=temp%></option>
									<%		            
										        }else{
										            if(tProv.isTradeFlatProv.equals("0") && tProv.isTradeFlatManuf.equals("0")){
										                temp = "(采购网配送)";
										            }
									%>
													<option value="<%=tProv.providerId + "-" + tProv.manufId +"-"+tProv.manufUnitprice+"-"+tProv.mode+"-"+tProv.modename+"-"+tProv.isTradeFlatManuf+"-"+GSBaseManager.getIsTradeManuf(tProv.isTradeFlatManuf)+"-"+tProv.validity%>"><%=tProv.providerName%><%=temp%></option>									
									<%		            
										        }
										    }
										}
									%>
									</select>
									</div>
								</td>								
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<input type="text" name="orderCounts" id="count<%=i%>" size="5" value="<%=tStr[9]%>" 
										onKeyUp="calculate(count<%=i%>,price<%=i%>,total<%=i%>)" maxlength="15"><%=tStr[10]%>
									</div>
								</td>																									
								<td class=top align=middle> 
									<div align="center" class="txt_content" id="price<%=i%>">
									<%=tStr[11]%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content" id="total<%=i%>">
									<%=tStr[12]%>
									</div>
								</td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=GSBaseManager.getOrderDetailStatusName(tStr[13])%>
									</div>
								</td>																															
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<input type="text" onfocus="setday(this)" size="10" readonly value="<%=tStr[14]%>" name="deliverGoodsDates">
									</div>
								</td>															
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<select name="deliverGoodsTimes">
									<% 
										String[][] time = GSBaseManager.getDeliverGoodsTimeType();
										for(int j=0; j<time.length; j++){
										    String[] tDevTime = time[j];
										    if(tDevTime[0].equals(tStr[15])){
									%>
										<option value="<%=tDevTime[0]%>" selected><%=tDevTime[1]%></option>
									<%		        
										    }else{
									%>
										<option value="<%=tDevTime[0]%>"><%=tDevTime[1]%></option>
									<%	        
										    }
										}
									%>
									</select>		
									</div>
								</td>	
                                <td class=top align=middle> 
                                    <div align="center" class="txt_content" id="divmode<%=i %>">
                                    <%=tStr[20] %>
                                    </div><input type="hidden" size="10"  value="<%=tStr[19]%>" name="mode" id="mode<%=i %>">
                                </td>																	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root+"/A150304.do")%>?orderId=<%=tStr[17]%>&orderDetailId=<%=tStr[0]%>" target="_blank">详细</a>
									</div>
								</td>																																								
							</tr> 
					<%
						}
					%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="19" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm='orderdetailmodifyform'/>
						    </td>
						  </tr>					
				    <%
						}else{
					%>
							<tr class="bg_column" height=20>
                            <td width="960" height="16" colspan="19" align="center">
                                    <font color="red">没有符合条件的订单信息</font>
                            </td>
                          </tr> 
                            
					<%
						}
					%>
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
	</table>
	</center>
	<form name="submitform" method="post">
		<div style='display:none'>		
	<%
		if(tList != null && tList.size() > 0){	
			for(int i=0; i< tList.size();i++){
	%>

	<input type="checkbox" name = "orderDetailIds2">
    <input type="checkbox" name="provManufInfos2">  		
    <input type="checkbox" name="orderCounts2">  				
    <input type="checkbox" name="deliverGoodsDates2">  		
    <input type="checkbox" name="deliverGoodsTimes2">  	
    <input type="checkbox" name="orderDtlStatus2"> 
    <input type="checkbox" name="isTradeFlatManuf2">     	
    <input type="checkbox" name="isTradeFlatProvider2">
    <input type="checkbox" name="sign2">      	    
	<%			    
			}
		}
	%>
	</div>
	</form>
	<p align="center">  
<!--    <input type="image" src="<%=response.encodeURL(root+"/images/button/tijiao.gif")%>" onclick="process('T')">&nbsp;-->
<!--    <input type="image" src="<%=response.encodeURL(root+"/images/button/daying.gif")%>" width="58" height="24" class="box" onclick="if(confirm('是否确定打印？')) print_bill(); else return false;"/>&nbsp;-->
		<input type="button" class="kuang" value="保存" onClick="process('S')">
    </p>	
<%		
	}
	if(tOrder != null && isRequery != null && isRequery.equals("true")){
%>
	<font size="2">数据查询中......</font>
<%		
	}
%>
<script type="text/javascript">
function calculate2(fcount,fprice,fresult){
        amt = 0.0;
        if(isEmpty(fcount.value)){
            alert("订货数量不能为空!");
            //document.all.fcount.focus();
            return false;
        }
        if(isNaN(fcount.value)){
            alert("订货数量必须为数字（包含小数）!");
            //document.all.fcount.focus();  
            fcount.value = "";      
            return false;           
        }else if(!isNaN(fcount.value)){
            if(fcount.value==0)
            {
                alert("订货数量必须大于0!");
                return false;
            }
            var val = parseFloat(fcount.value,10);
            var temp = fprice + "0";
            var price = parseFloat(fprice.innerText,1);
            amt =  val * price;
            amt = Math.round(amt * 10000)/10000;
            fresult.innerText = amt;
        }       
    }
    function changepr(val,fprice,fcount,fresult,fmode,fmodename,divism,ism,istf,issta,opid){
        var temp =val.value.split('-');
        var option=val.options;
        if(issta.value=='9'){
            alert("不能修改订货中的供应商，需要修改请先取消订单");
            for(var i=0;i<option.length;i++){
                var t=option[i].value.split('-');
                if(t[0]==opid.value){
                    val.selectedIndex=i;
                }
            }
            return false;
        }else{
            if(temp[0]!=opid.value){
                if(temp[temp.length-1]=='0'){
                    alert("选择修改的供应商无效！");
                    for(var i=0;i<option.length;i++){
                        var t=option[i].value.split('-');
                        if(t[0]==opid.value){
                            val.selectedIndex=i;
                        }
                    }
                }
            }
            return false;
        }
        fprice.innerText = temp[2];
        fmode.value=temp[3];
        fmodename.innerText=temp[4];
        ism.value=temp[5];
        istf.value=temp[5];
        divism.innerText=temp[6];
        calculate2(fcount,fprice,fresult);
    }
</script>
</body>
</html>